#include "NetworkAdapter.h"
#include <QNetworkInterface>

NetworkAdapter::NetworkAdapter(QObject *parent)
	: QObject(parent)
{

}

NetworkAdapter::~NetworkAdapter()
{

}

QList<QString> NetworkAdapter::AllNetworkInterface()
{
	QList<QString> listIp;

	QList<QHostAddress> vAddressList = QNetworkInterface::allAddresses(); 
	for(int i=0;i<vAddressList.size();i++)  
	{  
		if((vAddressList.at(i)!=QHostAddress::LocalHost)&&(vAddressList.at(i).protocol()==QAbstractSocket::IPv4Protocol))  
		{
			listIp.push_back(vAddressList.at(i).toString());
		} 
	}

	return listIp;
}